package org.csmzxy.class2333;

public class Example12 {
    public static void main(String[] args) {
        int sum = 0;    //累加结果
        int i = 1;      //当前整数
        while ( i<= 100){
            sum += i;           //将当前整数累加到sum中
            i++;                //i自增1
        }
        System.out.println("sum = " + sum);
    }
}
